﻿using BattleBotsMattAndSunny.Components.Interfaces;
using Robocode;

namespace BattleBotsMattAndSunny.Components.Guns
{
    public class BasicGunner : IGunManager
    {
        private AdvancedRobot robot { get; set; }

        private IDataManager dataManager { get; set; }

        public BasicGunner(IDataManager dm, AdvancedRobot r)
        {
            dataManager = dm;
            robot = r;
        }

        public void OnScannedRobot(ScannedRobotEvent e, double power)
        {
            Fire(power);
        }

        public void Fire(double power)
        {
            dataManager.StoreBullet(robot.SetFireBullet(power));
            //robot.Execute();
        }

        public void Move()
        {
        }
    }
}